#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n, m;
    cin >> n >> m;
    int summ = 0;
    vector < vector <int> > array(n, vector <int> (m) );
    for(int i = 0; i<n;i++){
        for(int j = 0; j<m;j++)
            cin>>array[i][j];
    }
    for(int j = 0; j<m;j++){
        for(int i = 0; i<n;i++) {
            summ+=array[i][j];
        }
        cout<<summ<<" ";
        summ = 0;
    }

}